Translate into your language!

Scripting Laboratory

Overview

This powerful utility lets you write scripts within Lotto Sorcerer. For a detailed explanation of what you can do with scripts, please see the Lotto Sorcerer User's Guide, Appendix A: LS Script Introduction. For tutorials, see Appendix B: LS Script Tutorials. And for the Programmer's Reference Guide, see Appendix C: LS Script Programmer's Reference Guide.

How to Invoke

Use the menu item "Utilities > Scripting Laboratory" .

Basic Procedure

Window Controls - "Source Code" Tab

"Source Code" Text Area

This is where you can type or edit the script's source code.

"Save" button

Clicking this button opens up a file selector, allowing you to save your script. It is strongly recommended that you save your scripts with a ".bas" extension.

"Save As" button

Clicking this button opens up a file selector, allowing you to save your script under a different name. Again, it is strongly recommended that you save your scripts with a ".bas" extension.

"Load" button

Use this to load an existing script.

"Clear" button

This will clear the Source Code text area.

"Reset" button

This clears all variables from memory, clears the Source Code text area, the Output text field on tab 2 of the Scripting Laboratory, and the Grid on tab 3 of the Scripting Laboratory.

"Run" button

Clicking this executes the script.

Saving, Loading and Running Encrypted Scripts

With the Scripting Laboratory, you can save, load and run two different types of encrypted scripts:
  1. Encrypted Scripts
  2. Keyed Encrypted Scripts
The first type, "Encrypted Scripts" can be run by anyone with Lotto Sorcerer's Scripting Laboratory. However, anyone loading this type of encrypted script cannot view the source code.

The second type, "Keyed Encrypted Scripts" can only be run by someone who knows the password. No feedback is given to the user if the person enters the wrong password; the script will simply not work, and will present error messages.

Important: in both types of scripts, the source code is never visible and cannot be made visible. If you save a script as an encrypted file (either type), you should save an unencrypted version of the script for your own use.

To save or load encrypted scripts, right-click (Windows) or control-click (Mac) in the Source Code text field. You will be presented with a contextual (popup) menu, with four choices:

"Load Encrypted Source File"

You will be presented with a file selector. Choose the encrypted source file. The source code will not be displayed, but you will be able to run it.

"Load Keyed Encrypted Source File"

You will be presented with a file selector. Choose the encrypted source file. You will then be prompted for the password (4 digits). There is no feedback if you entered the wrong password. The symptom of entering a wrong password is that the script will not run.

If you enter the password correct, the source code will not be displayed, but you will be able to run it.

"Save As Encrypted Source File"

This opens up a file selector, allowing you to save the source code as an encrypted file. It is strongly recommended that you use the ".ebas" file extension.

"Save As Keyed Encrypted Source File"

This opens up a file selector, allowing you to save the source code as an encrypted file. You will be prompted for a password. Enter carefully, there is no verification.

It is strongly recommended that you use the ".ebas" file extension.

Important! The encryption method used is to be considered low-level encryption. It will keep most prying eyes away, but it is not unbreakable code.

Window Controls - "Output" Tab

This tab is for displaying text results from the script, using the PRINT keyword within the script. Be sure to review the documentation for this command in the Programmer's Reference Guide in the Lotto Sorcerer User's Guide.

Once you have data in the Output tab, you have three controls available:

"Save" Button

This opens up a standard file selector, allowing you to save the contents of the Output text area to a text file.

"Copy" Button

This copies the contents of the Output text area to the System Clipboard.

"Clear" Button

This clears the Output text area.

Window Controls - "Grid" Tab

This is another way to output data from your script. You can control the number of columns, names of the columns, the widths of the columns and the alignment of the columns. Methods are described in the Programmer's Reference Guide and shown in the third example in the LS Script Tutorial (both of which are in the Lotto Sorcerer User's Guide).

"Save" Button

This opens up a standard file selector, allowing you to save the contents of the Grid as a tab-delimited text file.

"Export" Button

This invokes a file selector, allowing you to save the grid as a Microsoft Excel spreadsheet.

"Clear" Button

This clears the Grid.

Window Controls - "Graphics" Tab

The graphics tab lets you create your own column, pie, line, area, xy (scatter), bar charts and much more. Methods are described in the Programmer's Reference Guide and shown in the fourth example in the LS Script Tutorial.

After the grid is populated with data from your script, you have one control available:

"Save" Button

This invokes a file selector, allowing you to save the canvas in several different image formats.

Window Controls - "Batch" Tab

The Batch tab lets you run multiple scripts, sequentially, in a process known as batch processing. Furthermore, it give you the ability to run dynamic batches... i.e., batches where you can alter the batch while the batch is running (by using the AppendBatchLine command.

Not only can you run scripts you specify, you can also invoke another batch file. However, if you do so, the batch file must be the last item on the list, because, once this line is invoked, the batch list is cleared and populated with the contents of the batch you invoked. The above screenshot shows three scripts (with the ".bas" extension), followed by one batch file (with the ".bat" extension).

What can you do with batch processing? One possibility would be automating the process where Lotto Sorcerer can run suggestions with different settings, and checking to see which setting yields the best result (most number of wins). To do this manually, you would have to adjust the settings in the Projection Parameters tab in the main window; run the suggestions; check the suggestions to see how many suggestions resulted in wins; go back and adjust the parameters again, run the suggestions again, and so forth. But with batch processing, this process can be completely automated. The entire process would take hours, or even days to run, but it would be able to be run unattended.

There are a few important points to remember when doing batch processing:

Any scripts used must not have any interactive elements in them, where the script stops, waiting for user input. Examples of "interactive elements" would be:

The delay setting is absolutely critical. The delay is the third column in the Batch tab. This delay does not refer to the delay between scripts, but the delay that the batch processor will wait until launching the next script. If you have a script that takes a long time (for example, suggestion generation), you must make sure that the delay is long enough so that the script can finish.

Scripts and batches must be located in the default location. Scripts that are invoked within the batch file must be located in the "Scripts" folder of the "Lotto Sorcerer v9 Files" folder (which is located in your "Documents" folder. Batch files invoked from within the batch must be located in the "Batch Files" folder.

Only standard (non-encrypted) scripts can be used in a batch.

"Add Script" Button

This button is at the far bottom-left corner of the window. Click this, and a file selector will open. Choose the script to add to the list.

"Add Batch" Button

This button located at the bottom of the window, second from the left. Click this, and a file selector will open. Choose the batch to add to the list. Only one batch file can exist in the batch list, and it must be the last item on the list.

"Delete Item" Button

This button located at the bottom of the window, third from the left. Choose an item in the batch list that you want to delete, then click this button to delete the item from the list.

"Load" Button

This button loads in a previously saved batch list.

"Save Item" Button

This button lets you save the current file list as a batch file.

"Clear" Button

This button clears the batch file list.

"Execute" Button

This button executes the batch. The progress of the batch will be shown to the left of the Execute button. To prematurely quit the running batch, just close the Scripting Laboratory window.